//:C12:AutomaticOperatorEquals.cpp
 #include <iostream>
 using namespace std;
 class Cargo
 {
     public:
        Cargo &operator=(const Cargo &)
        {
            cout << "inside Cargo::operator=()" << endl;
            return *this;
        }
 };

 class Truck
 {
     Cargo b;
 };

 int main(void)
 {
     Truck a, b;
     a = b;    // Prints: "inside Cargo::operator=()"
 }